/*

*/
restricted

	var
		initial
		minimum
		current
		maximum

	New(var/minimum = 0, var/current = 100, var/maximum = 100)
		src.minimum = minimum
		src.maximum = maximum
		src.initial = maximum
		set_current(current)

	proc
		greater_than_percent(perc)
			return current > maximum*(perc/100)

		less_than_percent(perc)
			return current < maximum*(perc/100)

		greater_than_number(num)
			return current > num

		less_than_number(num)
			return current < num

		set_current(number)
			number = max(src.minimum, number)
			number = min(src.maximum, number)
			src.current = number

		set_current_to_max()
			set_current(maximum)

		set_current_to_min()
			set_current(minimum)

		reset()
			set_current(initial)

		decrement()
			decrease(1)

		increment()
			increase(1)

		decrease(number)
			increase(-number)

		increase(number)
			set_current(src.current + number)

		at_min()
			return src.current == src.minimum

		at_max()
			return src.current == src.maximum

		is_max(number)
			return number == src.maximum

		is_min(number)
			return number == src.minimum

		set_min(number)
			minimum=min(src.maximum, number)

		set_max(number)
			maximum=max(src.minimum, number)

		to_percent()
			return (current/maximum)*100

		to_percent_text()
			return "[to_percent()]%"

		to_text()
			return "[current] / [maximum]"

		get_current()
			return src.current

		get_maximum()
			return src.maximum

		get_minimum()
			return src.minimum

		init()
			return src.initial

		//++
		i()
			increment()

		//--
		d()
			decrement()

		//+=
		add(number)
			increase(number)

		//-=
		sub(number)
			decrease(number)
